package com.cy.pj.sys.web.config;

import com.cy.pj.sys.web.interceptor.TimeAccessInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration//此注解为spring中的一个配置类bean对象(也就是将这个配置类交给spring去管理)
public class SpringWebConfig implements WebMvcConfigurer{
    /**
     * 注册拦截器(将拦截器添加到spring容器)
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //注册拦截器(将拦截器添加到spring容器)
        registry.addInterceptor(new TimeAccessInterceptor())
                //设置要拦截的url
//                .addPathPatterns("/notice/doFindNotices");
        .addPathPatterns("/notice/doFindNotices","/notice/doDeleteById/*");
    }


}
